<!DOCTYPE html>
<html    xmlns:th="http://www.thymeleaf.org">

<head th:replace="comm/common :: header(~{::title},~{},~{})">
    <title>角色分配</title>
</head>

<body>
<form class="layui-form" action="" id="allotRolesForm">
    <input type="hidden" name="userId" th:value="${user.id}"  autocomplete="off" class="layui-input">
    <div class="layui-form-item" style="margin-top: 20px;">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" lay-verify="title" th:value="${user.userAccount}" disabled="" autocomplete="off" placeholder="请输入标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <select name="roleIds" xm-select="roleNameSelect"></select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" id="allotRolesSubmit" lay-submit="">立即提交</button>
        </div>
    </div>
</form>
<div th:replace="comm/common :: bottom"></div>
<script th:src="@{/admin/user/allot_role.js}"></script>
<script>
    formSelects.render("roleNameSelect");
    var url = '/sso/admin/role/allRoleByUserId?userId='+[[${user.id}]];
    formSelects.data('roleNameSelect', 'server', {
        url: url,
        delay: 500
    });
</script>

</body>

</html>
